import { getQuestionList } from '@/services/modules/question'
import { IQuestionItem, QuestionItem } from '@/utils/interface'
import { makeAutoObservable } from 'mobx'

class Question {
    constructor(){
        makeAutoObservable(this)
    }

    // 问题列表数据
    questionList:IQuestionItem[] = []
    // 问题列表数据总数
    total = 1
    //获取列表数据的方法
    async getQuestionList(type:string,quality:string,authentication:string,questionTitle:string,pageNum:number){
        let result = await  getQuestionList(type,quality,authentication,questionTitle,pageNum)
        this.questionList = result.rows
        this.total = result.total
    }
}

export default new Question